package com.example.cny.activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.cny.R;
import com.example.cny.contract.LoginContract;
import com.example.cny.presenter.LoginPresenter;
import com.example.mylibrary.base.BaseActivity;
import com.example.mylibrary.base.BaseNoDaggerActivity;
import com.example.mylibrary.di.component.BaseComponent;

import butterknife.BindView;
import butterknife.OnClick;

public class LoginActivity extends BaseNoDaggerActivity implements LoginContract.View, View.OnClickListener {
    Button loginBtn;
    TextView forgetPwdBtn;
    TextView newUserRegisterBtn;

    private EditText loginId;
    private EditText loginPwd;

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.login_btn:
                login();
                break;
            case R.id.forget_pwd_btn:
                startActivity(new Intent(this,ForgetPwdActivity.class));
                break;
            case R.id.new_user_register_btn:
                startActivity(new Intent(this,RegisterActivity.class));
                break;
        }
    }

    @Override
    public void login() {
        startActivity(new Intent(this,ActiveDevicesActivity.class));
    }

    @Override
    public void regiter() {

    }

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_login;
    }

    @Override
    protected void initData() {
        newUserRegisterBtn = findViewById(R.id.new_user_register_btn);
        loginBtn = findViewById(R.id.login_btn);
        forgetPwdBtn = findViewById(R.id.forget_pwd_btn);
        loginId = findViewById(R.id.login_id);
        loginPwd = findViewById(R.id.login_pwd);
        newUserRegisterBtn.setOnClickListener(this);
        loginBtn.setOnClickListener(this);
        forgetPwdBtn.setOnClickListener(this);
    }
}
